package com.dynamic.model.util.common;

import javax.servlet.http.HttpServletRequest;

public class RequestUtil {
	public static String getDomain1(HttpServletRequest request){
		StringBuffer url = request.getRequestURL();
		return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getServletContext().getContextPath()).append("/").toString();
	}
	public static String getDomain2(HttpServletRequest request){
		StringBuffer url = request.getRequestURL();  
		return url.delete(url.length() - request.getRequestURI().length(), url.length()).append("/").toString();
	}
}
